package com.ellricky.excute_president.ui.activity.meet

import com.ellricky.baselib.http.callback.ECallback
import com.ellricky.baselib.ui.base.BaseDetailActivity
import com.ellricky.excute_president.API_AM_MEETING_DETAIL
import com.ellricky.excute_president.AmMeetingDetailEntity
import com.ellricky.excute_president.R
import kotlinx.android.synthetic.main.pd_activity_ammeeting_detail.*

class AmMeetingDetailActivity : BaseDetailActivity() {

    override fun getChildContentLayout(): Int {
        return R.layout.pd_activity_ammeeting_detail
    }


    override fun initUIView() {
        super.initUIView()
        mTvTitle.text = getString(R.string.pd_am_detail)
        loadDetail(id)

    }

    private fun loadDetail(id: String) {
        mPresenter.loadDetail(
                API_AM_MEETING_DETAIL, id, object : ECallback<AmMeetingDetailEntity>(this) {
            override fun onSuccess(data: AmMeetingDetailEntity?, msg: String) {
                data?.let {
                    tvTitle.text = it.meetTitle
                    tvAreaName.text = it.areaName
                    tvFzTeacher.value = it.name
                    tvDate.value = it.meetDate
                    tvContent.text = it.meetInfo
                }
            }
        })

    }


}
